/**
 * Created by zhangxiaoyu on 16/12/01.
 */
var hyt_route = angular.module("hyt.route", []);

hyt_route.config(["$stateProvider", "$urlRouterProvider","$ionicConfigProvider", function ($stateProvider, $urlRouterProvider,$ionicConfigProvider) {
    $ionicConfigProvider.platform.ios.tabs.style('standard');
    $ionicConfigProvider.platform.ios.tabs.position('bottom');
    $ionicConfigProvider.platform.android.tabs.style('standard');
    $ionicConfigProvider.platform.android.tabs.position('standard');

    $ionicConfigProvider.platform.ios.navBar.alignTitle('center');
    $ionicConfigProvider.platform.android.navBar.alignTitle('center');

    $ionicConfigProvider.platform.ios.backButton.previousTitleText('').icon('ion-ios-arrow-thin-left');
    $ionicConfigProvider.platform.android.backButton.previousTitleText('').icon('ion-android-arrow-back');

    $ionicConfigProvider.platform.ios.views.transition('ios');
    $ionicConfigProvider.platform.android.views.transition('android');
    $stateProvider
      .state('tab', {
        url: '/tab',
        abstract: true,
        templateUrl: 'templates/tabs.html'
      })

      //工具
      .state('tab.tool', {
        url: '/tool',
        views: {
          'tab-tool': {
            templateUrl: 'templates/tab-tool/tools.html',
            controller:'toolsCtrl'
          }
        }
      })

      //工作台
      .state('tab.workbench', {
        cache:false,
        url: '/workbench',
        views: {
          'tab-workbench': {
            templateUrl: 'templates/tab-workbench/workbench.html',
            controller:'workbenchCtrl'
          }
        }
      })

      //我
      .state('tab.person', {
        cache:false,
        url: '/person',
        views: {
          'tab-person': {
            templateUrl: 'templates/tab-person/person.html',
            controller:'personCtrl'
          }
        }
      })

      //登录
      .state("login", {
        url: '/login',
        templateUrl: 'templates/home/login.html',
        controller: 'loginCtrl'
      })

      //忘记密码
      .state("forgetPwd", {
        cache:false,
        url: '/forgetPwd',
        templateUrl: 'templates/home/forgetPwd.html',
        controller:'forgetPwdCtrl'
      })

      //手机号验证
      .state("verification", {
        url: '/verification/:username',
        templateUrl: 'templates/home/verification.html',
        controller: 'verificationCtrl'
      })

      //受理开单
      .state("addWaybill", {
        cache:false,
        url: '/addWaybill/:orderId',
        templateUrl: 'templates/tab-workbench/addWaybill/addWaybill.html',
        controller: 'AddWaybillCtrl'
      })

      //我的订单
      .state("myOrder", {
        cache:false,
        url: '/myOrder/:htmlId',
        templateUrl: 'templates/tab-workbench/myOrder/orderList.html',
        controller: 'OrderListCtrl'
      })

      //中转订单运单
      .state("transWaybill", {
        cache:false,
        url: '/transWaybill/:id',
        templateUrl: 'templates/tab-workbench/myOrder/transWaybill.html',
        controller: 'TransWaybillCtrl'
      })

      //中转订单转运单
      .state("addTransWaybill", {
        cache:false,
        url: '/addTransWaybill/:LWID',
        templateUrl: 'templates/tab-workbench/myOrder/addTransWaybill.html',
        controller: 'AddTransWaybillCtrl'
      })

      //订单详情
      .state("orderDetail", {
        cache:false,
        url: '/orderDetail',
        templateUrl: 'templates/tab-workbench/myOrder/orderDetail.html',
        controller: 'OrderDetailCtrl'
      })

      //中转订单详情
      .state("transOrderDetail", {
        cache:false,
        url: '/transOrderDetail/:id',
        templateUrl: 'templates/tab-workbench/myOrder/transOrderDetail.html',
        controller: 'OrderDetailCtrl'
      })

      //回单管理
      .state('receiptTab', {
        url: '/receiptTab',
        abstract: true,
        templateUrl: 'templates/tab-workbench/receipt/receiptTabs.html'
      })

      //回单寄出
      .state('receiptTab.mail', {
        cache:false,
        url: '/mail',
        views: {
          'receiptTab-mail': {
            templateUrl: 'templates/tab-workbench/receipt/receiptTab-mail/mail.html',
            controller:'mailCtrl'
          }
        }
      })

      //回单接收
      .state('receiptTab.receive', {
        cache:false,
        url: '/receive',
        views: {
          'receiptTab-receive': {
            templateUrl: 'templates/tab-workbench/receipt/receiptTab-receive/receive.html',
            controller:'receiveCtrl'
          }
        }
      })

      //回单发放
      .state('receiptTab.grant', {
        cache:false,
        url: '/grant',
        views: {
          'receiptTab-grant': {
            templateUrl: 'templates/tab-workbench/receipt/receiptTab-grant/grant.html',
            controller:'grantCtrl'
          }
        }
      })

      //外发管理
      .state("outer", {
        cache:false,
        url: '/outer',
        templateUrl: 'templates/tab-workbench/outer/outerList.html',
        controller: 'transferCtrl'
      })

      //中转单详情
      .state("transDetail", {
        cache:false,
        url: '/transDetail/:id',
        templateUrl: 'templates/tab-workbench/outer/transDetail.html',
        controller: 'transDetailCtrl'
      })

      //添加货物
      .state("addGoods", {
        cache:false,
        url: '/addGoods',
        templateUrl: 'templates/tab-workbench/outer/addGoods.html',
        controller: 'addGoodsCtrl'
      })

      //填写中转信息
      .state("fillInCompany", {
        cache:false,
        url: '/fillIn/:transferFeeTotal',
        templateUrl: 'templates/tab-workbench/outer/fillInCompany.html',
        controller: 'FillInCompanyCtrl'
      })
      .state("fillInDriver", {
        cache:false,
        url: '/fillIn/:transferFeeTotal',
        templateUrl: 'templates/tab-workbench/outer/fillInDriver.html',
        controller: 'FillInDriverCtrl'
      })

      //客户签收
      .state('signTab', {
        url: '/signTab',
        abstract: true,
        templateUrl: 'templates/tab-workbench/sign/signTabs.html'
      })

      //未签收
      .state('signTab.not', {
        cache:false,
        url: '/not',
        views: {
          'signTab-not': {
            templateUrl: 'templates/tab-workbench/sign/signTab-not/notSign.html',
            controller:'notSignCtrl'
          }
        }
      })

      //已签收
      .state('signTab.already', {
        cache:false,
        url: '/already',
        views: {
          'signTab-already': {
            templateUrl: 'templates/tab-workbench/sign/signTab-already/alreadySign.html',
            controller:'alreadySignCtrl'
          }
        }
      })

      //签收详情
      .state("signMsg", {
        cache:false,
        url: '/signMsg/:id/:CONSIGNEE',
        templateUrl: 'templates/tab-workbench/sign/signTab-not/signMsg.html',
        controller: 'signMsgCtrl'
      })

      //签回单
      .state("receiptRecovery", {
        cache:false,
        url: '/receiptRecovery/:id/:RECEIPT_NUM',
        templateUrl: 'templates/tab-workbench/sign/signTab-already/receiptRecovery.html',
        controller: 'recoveryCtrl'
      })

      //我的运单
      .state("myWaybill", {
        cache:false,
        url: '/myWaybill',
        templateUrl: 'templates/tab-workbench/myWaybill/waybillList.html',
        controller: 'WaybillListCtrl'
      })

      //运单详情
      .state('detailTab', {
        url: '/detailTab',
        abstract: true,
        templateUrl: 'templates/tab-workbench/myWaybill/detailTabs.html'
      })

      //详情tab
      .state('detailTab.detail', {
        cache:false,
        url: '/detail',
        views: {
          'detailTab-detail': {
            templateUrl: 'templates/tab-workbench/myWaybill/detailTab-detail/waybillDetail.html',
            controller:'WaybillDetailCtrl'
          }
        }
      })

      //进程tab
      .state('detailTab.process', {
        cache:false,
        url: '/process',
        views: {
          'detailTab-process': {
            templateUrl: 'templates/tab-workbench/myWaybill/detailTab-process/waybillProcess.html',
            controller:'WaybillProcessCtrl'
          }
        }
      })

      //投保
      .state("insurance", {
        cache:false,
        url: '/insurance',
        templateUrl: 'templates/tab-workbench/insurance/insurance.html',
        controller: ''
      })

      //异常管理列表
      .state('abnormalList', {
        cache:false,
        url: '/abnormalList',
        templateUrl: 'templates/tab-workbench/abnormal/abnormalList.html',
        controller:'abnormalListCtrl'
      })

      //异常详情
      .state('abnormalDetail', {
        cache:false,
        url: '/abnormalDetail/:id',
        templateUrl: 'templates/tab-workbench/abnormal/abnormalDetail.html',
        controller:'abnormalDetailCtrl'
      })

      //异常上报-搜索运单
      .state('abnl_search', {
        cache:false,
        url: '/abnlSearch',
        templateUrl: 'templates/tab-workbench/abnormal/searchWaybill.html',
        controller:'searchListCtrl'
      })

      //异常上报-提交异常
      .state('reportAbnl', {
        cache:false,
        url: '/reportAbnl/:WAYBILL_ID/:WAYBILL_NO/:WAYBILL_STATUS',
        templateUrl: 'templates/tab-workbench/abnormal/reportAbnl.html',
        controller:'reportAbnlCtrl'
      })

      //打印设置
      .state('printSetting', {
        cache:false,
        url: '/printSetting',
        templateUrl: 'templates/tab-person/printSetting/printSetting.html',
        controller:'printSetCtrl'
      })

      //修改密码
      .state('changePw', {
        cache:false,
        url: '/changePw',
        templateUrl: 'templates/tab-person/changePw/changePw.html',
        controller:'confirmPwdCtrl'
      })
      .state('newPw', {
        cache:false,
        url: '/newPw',
        templateUrl: 'templates/tab-person/changePw/newPw.html',
        controller:'changePwdCtrl'
      })

      //关于我们
      .state('aboutUs', {
        url: '/aboutUs',
        templateUrl: 'templates/tab-person/aboutUs/aboutUs.html'
      })

      //意见反馈
      .state('feedback', {
        url: '/feedback',
        templateUrl: 'templates/tab-person/feedback/feedback.html',
        controller:'feedbackCtrl'
      })

      //计算器
      .state('calculator', {
        url: '/calculator',
        templateUrl: 'templates/tab-tool/calculator/calculator.html',
        controller:'calculatorCtrl'
      })

      //地图
      .state('gpsMap', {
        cache:false,
        url: '/gpsMap',
        templateUrl: 'templates/tab-tool/GPSMap/gpsMap.html',
        controller:'gpsMapCtrl'
      })

      //备忘录
      .state('note', {
        cache:false,
        url: '/note',
        templateUrl: 'templates/tab-tool/note/note.html',
        controller:'noteCtrl'
      })
      .state('addNote', {
        url: '/addNote/:content/:id',
        templateUrl: 'templates/tab-tool/note/addNote.html',
        controller:'noteCtrl'
      })

      //天气
      .state('weather', {
        url: '/weather/:city',
        templateUrl: 'templates/tab-tool/weather/weather.html',
        controller:'weatherCtrl'
      })

      //工作台-搜索运单
      .state('workbenchSearch', {
        cache:false,
        url: '/workbenchSearch',
        templateUrl: 'templates/tab-workbench/searchWaybill.html',
        controller:'workbenchSearchCtrl'
      })

      //工作台-消息
      .state('message', {
        cache:false,
        url: '/message',
        templateUrl: 'templates/tab-workbench/message/message.html',
        controller:'noticeListCtrl'
      })

      //系统消息
      .state('notice', {
        cache:false,
        url: '/notice',
        templateUrl: 'templates/tab-workbench/message/noticeList.html',
        controller:'noticeListCtrl'
      })

      .state('noticeDetail', {
        cache:false,
        url: '/noticeDetail/:title/:content',
        templateUrl: 'templates/tab-workbench/message/noticeDetail.html',
        controller:'noticeListCtrl'
      })
    // if none of the above states are matched, use this as the fallback
    $urlRouterProvider.otherwise('/login');
}])
;
